package pers.lmd.convert;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import pers.lmd.domain.dto.Article;
import pers.lmd.domain.dto.ArticleDTO;

/**
 * @Author lmd
 * @Date 2023/5/5 23:51
 */
@Mapper
public interface ArticleConvert {

    ArticleConvert INSTANCES = Mappers.getMapper(ArticleConvert.class);

    @Mappings({
            @Mapping(source = "title", target = "title"),
            @Mapping(source = "content", target = "content"),
    })
    Article toArticle(ArticleDTO articleDTO);
}
